<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html"
        >

    <p:dialog header="Adauga/Editeaza contract" widgetVar="add_contract_WV" dynamic="true" minHeight="300"
              width="900" modal="true">

        <h:form id="create_contract_form">

            <h:panelGrid columns="2" columnClasses="column-1, column-200" styleClass="form-elements">
                <p:outputLabel for="contract_number" value="Numar contract:"/>
                <p:inputText id="contract_number" value="#{employmentDataBean.selectedContract.contractNr}"
                             required="true"/>

                <p:outputLabel for="contract_data" value="Data contract:"/>
                <p:calendar id="contract_data" value="#{employmentDataBean.selectedContract.contractDate}"
                            required="true" pattern="dd/MM/yyyy"/>

                <p:outputLabel for="valid_from" value="Valabil din:"/>
                <p:calendar id="valid_from" value="#{employmentDataBean.selectedContract.fromDate}"
                            required="true" pattern="dd/MM/yyyy"/>

                <p:outputLabel for="valid_to" value="Valabil pana la:"/>
                <p:calendar id="valid_to" value="#{employmentDataBean.selectedContract.toDate}"
                            required="true" pattern="dd/MM/yyyy"/>

                <p:outputLabel for="trial_period" value="Termen de proba:"/>
                <p:inputText id="trial_period" value="#{employmentDataBean.selectedContract.trialPeriod}"
                             required="true"/>

                <p:outputLabel for="basic_contract" value="Principal:"/>
                <p:selectBooleanCheckbox id="basic_contract" value="#{employmentDataBean.selectedContract.basic}"/>

            </h:panelGrid>

            <p:outputPanel layout="block" style="border-top: 1px solid #A8A8A8; padding: 5px;">
                <p:commandButton icon="ui-icon-disk" value="Salveaza"
                                 update="@form :folder_details_content:folder_details_content:contracts_form"
                                 actionListener="#{employmentDataBean.saveContract}"
                                 oncomplete="if (args &amp;&amp; !args.validationFailed) add_contract_WV.hide()"/>
                <p:commandButton value="Renunta" onclick="PF('add_contract_WV').hide();" process="@none"/>
            </p:outputPanel>
        </h:form>
    </p:dialog>


</ui:composition>
